Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: Macintosh Toolbox Essentials

Previous | Chapter Top | Chapter Contents | Next |

Setting and Retrieving Other Window Characteristics

This section describes the functions that let you set and retrieve less commonly used fields in the window record.

SetWindowPic

Sets a picture for the Window Manager to draw in a window's content region.

pascal void SetWindowPic (WindowPtr theWindow,
                     PicHandle pic);
theWindow
A pointer to a window's window record.
Pic
A handle to the picture to be drawn in the window.

DESCRIPTION

The SetWindowPic function stores in a window's window record a handle to a picture to be drawn in the window. When the window's content region must be updated, the Window Manager then draws the picture or part of the picture, as necessary, instead of generating an update event.

The CloseWindow (CloseWindow) and DisposeWindow (DisposeWindow) functions assume that any picture pointed to by the window record field windowPic is stored as data, not as a resource. If your application uses a picture stored as a resource, you must release the memory it occupies by calling the Resource Manager's ReleaseResource function and set the WindowPic field to nil before you close the window.

GetWindowPic

Returns a handle to a window's picture.

pascal PicHandle GetWindowPic (WindowPtr theWindow);
theWindow
A pointer to the window's window record.

DESCRIPTION

The GetWindowPic function returns a handle to the picture to be drawn in a specified window's content region. The handle must have been stored previously with the SetWindowPic function (SetWindowPic) .

SetWRefCon

Sets the refCon field of a window record.

pascal void SetWRefCon (WindowPtr theWindow,
                     long data);
theWindow
A pointer to the window's window record.
data
The data to be placed in the refCon field.

DESCRIPTION

The SetWRefCon function places the specified data in the refCon field of the specified window record. The refCon field is available to your application for any window-related data it needs to store.

GetWRefCon

Returns the reference constant from a window's window record.

pascal long GetWRefCon (WindowPtr theWindow);
theWindow
A pointer to the window's window record.

DESCRIPTION

The GetWRefCon function returns the long integer data stored in the refCon field of the specified window record.

GetWVariant

Returns a window's variation code.

pascal short GetWVariant (WindowPtr theWindow);
theWindow
A pointer to the window's window record.

DESCRIPTION

The GetWVariant function returns the variation code of the specified window. Depending on the window's window definition function, the result of GetWVariant can represent one of the standard window types or a variation code defined by your own window definition function.

SEE ALSO

See "Variant Codes" for a detailed description of variation codes.


© 1997 Apple Computer, Inc.

Previous | Chapter Top | Chapter Contents | Next